package ch.fusun.baron.city;

import ch.fusun.baron.city.api.CityService;
import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.data.DataUpdate;

/**
 * Removes the designated {@link City}
 */
public class RemoveCityDataUpdate implements DataUpdate {

	private City city;
	@Inject
	private transient CityService cityService;

	/**
	 * Kryo
	 */
	public RemoveCityDataUpdate() {
	}

	/**
	 * @param city
	 *            The city to remove
	 */
	public RemoveCityDataUpdate(City city) {
		this.city = city;
	}

	@Override
	public void update() {
		cityService.removeCity(city);
	}

}
